<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">|This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">T|his is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-0 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">T|his is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">Th|is is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-1 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">Th|is is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">Thi|s is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-2 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">Thi|s is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This| is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-3 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This| is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This |is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-4 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This |is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This i|s \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-5 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This i|s \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is| \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-6 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is| \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is |\u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-7 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is |\u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9|\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-8 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9|\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5|\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-9 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5|\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA|\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-10 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA|\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8| \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-11 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8| \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 |\u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-12 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 |\u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6|\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-13 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6|\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8| \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-14 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8| \u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 |\u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-15 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 |\u05DE\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE|\u05D9\u05EA\u05E8 the boxes.</div>',
  '21-16 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE|\u05D9\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9|\u05EA\u05E8 the boxes.</div>',
  '21-17 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9|\u05EA\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA|\u05E8 the boxes.</div>',
  '21-18 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA|\u05E8 the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8| the boxes.</div>',
  '21-19 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8| the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 |the boxes.</div>',
  '21-20 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 |the boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 t|he boxes.</div>',
  '21-21 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 t|he boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 th|e boxes.</div>',
  '21-22 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 th|e boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the| boxes.</div>',
  '21-23 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the| boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the |boxes.</div>',
  '21-24 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the |boxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the b|oxes.</div>',
  '21-25 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the b|oxes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the bo|xes.</div>',
  '21-26 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the bo|xes.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the box|es.</div>',
  '21-27 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the box|es.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxe|s.</div>',
  '21-28 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxe|s.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes|.</div>',
  '21-29 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes|.</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.|</div>',
  '21-30 rtl left character');

selection_test(
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.|</div>',
  selection => selection.modify('move', 'left', 'character'),
  '<div contenteditable dir="rtl" style="width: 100px;">This is \u05D9\u05D5\u05EA\u05E8 \u05E6\u05E8 \u05DE\u05D9\u05EA\u05E8 the boxes.|</div>',
  '21-31 rtl left character');
</script>
